/*
 * StackOfFilesToDownload.java
 *
 * Created on 13 de Fevereiro de 2009, 20:46
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package core.connector;

import gui.factory.components.AbstractDownload;
import gui.factory.components.AbstractListFiles;
import java.io.File;
import java.io.IOException;
import java.net.ProtocolException;
import java.net.UnknownHostException;
import java.util.List;

/**
 *
 * @author vinicius
 */
public class ConnectorOnlyToDownload extends Connector{
    
    Connector parent;
    Connector mirror;
    
    
    public ConnectorOnlyToDownload(ConnectionDetails connectionDetails ,Connector parent) {
        this.parent = parent;
        mirror = ConnectorFactory.getInstance(connectionDetails);
    }

    public boolean connect() {
        return mirror.connect();
    }

    public void disconnect() {
        mirror.disconnect();
    }

    public boolean isConnected() {
        return mirror.isConnected();
    }

    public ConnectionDetails getConnectionDetails() {
        return parent.getConnectionDetails();
    }

    public int getNumberOfFiles() {
        return mirror.getNumberOfFiles();
    }

    public void getFile(DownloadableItem a, File b, AbstractDownload c) throws IOException, ProtocolException, UnknownHostException, Exception {
        mirror.getFile(a,b,c);
    }

    public boolean getNextFile() throws Exception {
        return mirror.getNextFile();
    }

    public boolean canSort() {
        return mirror.canSort();
    }

    public boolean canDownloadSimultaneously() {
        return mirror.canDownloadSimultaneously();
    }

    public void setNickname(String name) {
        parent.setNickname(name);
    }

    public void startListing(AbstractListFiles listaArquivosGUI) {
        parent.startListing(listaArquivosGUI);
    }

    public void initDownload(List<DownloadableItem> itemsToDownload, File destinationFolder) {
        parent.initDownload(itemsToDownload, destinationFolder);
    }

    public void setAsSon(List<DownloadableItem> a, File b, AbstractListFiles c, ThreadDownload[] d) {
        parent.setAsSon(a, b, c, d);
    }

    public void addFileToDownload(DownloadableItem downloadableItem) {
        parent.addFileToDownload(downloadableItem);
    }

    public void confirmEndOfThisThreadDownload(ThreadDownload finishedThreadDownload, boolean withError) {
        parent.confirmEndOfThisThreadDownload(finishedThreadDownload, withError);
    }

    public void setDestinationFolder(File destinationFolder) {
        parent.setDestinationFolder(destinationFolder);
    }

    public void setItemsToDownload(List<DownloadableItem> itemsToDownload) {
        parent.setItemsToDownload(itemsToDownload);
    }

    public String toString() {
        String retValue;
        
        retValue = parent.toString();
        return retValue;
    }

    public DownloadableItem getNextFileToDownload() {
        DownloadableItem retValue;     
        retValue = parent.getNextFileToDownload();
        return retValue;
    }

    public boolean hasFileToDownload() {
        boolean retValue;
        
        retValue = parent.hasFileToDownload();
        return retValue;
    }

    public void startDownload() {
        parent.startDownload();
    }

    public void stopDownload() {
        parent.stopDownload();
    }

    public void stopListing() {
        parent.stopListing();
    }

    public List<DownloadableItem> getItemsToDownload() {
        List retValue;
        
        retValue = parent.getItemsToDownload();
        return retValue;
    }

    public Connector getInstance() {
        Connector retValue;
        
        retValue = parent.getInstance();
        return retValue;
    }
    
    
}
